<template>
  <div class="scenery-container flex  flex-column">
    <div class="scenery-title flex align-center">
      <div :class="['tab', { 'active': tabIndex === index }]" v-for="(item, index) in tabs" :key="index"
        @click="changeTab(index)">{{
          item.name }}
      </div>
    </div>
    <!-- 主播排班 -->
    <div class="scenery-content flex flex1" v-show="tabIndex === 0">
      <div class="left">
        <div class="left-title flex align-center justify-between">
          <h3>排班列表</h3>
          <div class="btn">新增</div>
        </div>
        <div class="left-list">
          <div :class="['list-item flex', { 'active': index === listItemIndex }]" v-for="(item, index) in leftGoods"
            :key="index" @click="changeListItem(index)">
            <div class="item-img">
              <img :src="item.img" width="80px" height="80px" alt="">
            </div>
            <div class="item-desc flex flex-column justify-between">
              <div class="name flex1">{{ item.name }}</div>
              <div class="action flex justify-between">
                <div class="btn">删除</div>
                <div class="btn">编辑</div>
                <div class="btn">下移</div>
                <div class="btn">上移</div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="right flex1">
        <div class="right-top flex  justify-between">
          <div class="top-item">
            <div class="title flex align-center justify-between">
              <h3>主播声音</h3>
              <div class="btn">更换</div>
            </div>
            <div class="flex align-center ">
              <div class="play-box flex align-center justify-center">
                <el-icon size="50">
                  <VideoPlay />
                </el-icon>
              </div>

              <div class="action-box flex flex-column justify-between">
                <div class="cell flex align-center">
                  <span> 音量： </span>
                  <el-slider v-model="volume" :min="0" :max="100" size="small"></el-slider>
                  <span>{{ volume }}</span>
                </div>
                <div class="cell flex align-center">
                  <span> 语速： </span>
                  <el-slider v-model="speed" :min="0" :max="100" size="small"></el-slider>
                  <span>{{ speed }}</span>
                </div>
                <div class="cell flex align-center">
                  <span> 语调： </span>
                  <el-slider v-model="intonation" :min="0" :max="100" size="small"></el-slider>
                  <span>{{ intonation }}</span>
                </div>
              </div>
            </div>
          </div>
          <div class="top-item">
            <div class="title flex align-center justify-between">
              <h3>主播声音</h3>
              <div class="btn">更换</div>
            </div>
            <div class="flex align-center ">
              <div class="play-box flex align-center justify-center">
                <el-icon size="50">
                  <VideoPlay />
                </el-icon>
              </div>

              <div class="action-box flex flex-column justify-between">
                <div class="cell flex align-center">
                  <span> 音量： </span>
                  <el-slider v-model="volume" :min="0" :max="100" size="small"></el-slider>
                  <span>{{ volume }}</span>
                </div>
                <div class="cell flex align-center">
                  <span> 语速： </span>
                  <el-slider v-model="speed" :min="0" :max="100" size="small"></el-slider>
                  <span>{{ speed }}</span>
                </div>
                <div class="cell flex align-center">
                  <span> 语调： </span>
                  <el-slider v-model="intonation" :min="0" :max="100" size="small"></el-slider>
                  <span>{{ intonation }}</span>
                </div>
              </div>
            </div>
          </div>
        </div>

        <div class="right-down">
          <h3>主播选择</h3>
          <el-row :gutter="20">
            <el-col :span="4" class="flex-col">
              <span class="label">类型</span>
              <el-select size="small">
                <el-option label="全部" :value="0"></el-option>
                <el-option label="我的" :value="1"></el-option>
                <el-option label="公共" :value="2"></el-option>
              </el-select>
            </el-col>
            <el-col :span="4" class="flex-col">
              <span class="label">性别</span>
              <el-select size="small">
                <el-option label="全部" :value="0"></el-option>
                <el-option label="男" :value="1"></el-option>
                <el-option label="女" :value="2"></el-option>
              </el-select>
            </el-col>
            <el-col :span="4" class="flex-col">
              <span class="label">姿势</span>
              <el-select size="small">
                <el-option label="全部" :value="0"></el-option>
                <el-option label="站姿" :value="1"></el-option>
                <el-option label="坐姿" :value="2"></el-option>
              </el-select>
            </el-col>
            <el-col :span="4" class="flex-col">
              <span class="label">状态</span>
              <el-select size="small">
                <el-option label="全部" :value="0"></el-option>
                <el-option label="可用" :value="1"></el-option>
                <el-option label="制作中" :value="2"></el-option>
              </el-select>
            </el-col>
          </el-row>
          <div class="right-list flex flex-wrap">
            <div class="list-item" v-for="(item, index) in anchors" :key="index">
              <img :src="item.img" alt="">
              <div class="action flex justify-between">
                <div>{{ item.name }}</div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- 智能切景 -->
    <div class="scenery-content flex flex1" v-show="tabIndex === 1">
      <div class="left">
        <div class="left-title flex align-center justify-between">
          <h3>直播商品</h3>
          <div class="btn">智能切品</div>
          <div class="btn">新增</div>
          <el-icon size="20">
            <Refresh />
          </el-icon>
        </div>
        <div class="left-list">
          <div :class="['list-item flex', { 'active': index === listItemIndex }]" v-for="(item, index) in leftGoods"
            :key="index" @click="changeListItem(index)">
            <div class="item-img">
              <img :src="item.img" width="80px" height="80px" alt="">
            </div>
            <div class="item-desc flex flex-column justify-between">
              <div class="name flex1">{{ item.name }}</div>
              <div class="action flex justify-between">
                <div class="btn">删除</div>
                <div class="btn">编辑</div>
                <div class="btn">下移</div>
                <div class="btn">上移</div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="right flex1 justify-center">
          <DraggStickerCom></DraggStickerCom>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { ElMessage } from 'element-plus'
import { VideoPlay } from '@element-plus/icons-vue'
import DraggStickerCom from '@/components/DraggStickerCom/index.vue'
import imgSrc from '@/assets/image.png'

const volume = ref(0)
const speed = ref(0)
const intonation = ref(0)

const anchors = ref([
  {
    img: imgSrc,
    name: '主播1',
  },
  {
    img: imgSrc,
    name: '主播2',
  },

])

const tabs = ref([
  {
    name: '主播排班'
  },
  {
    name: '智能切景'
  }
])

const tabIndex = ref(0)
const listItemIndex = ref(0)

const leftGoods = ref([
  {
    name: '主播名称1',
    img: imgSrc,
  },
  {
    name: '主播名称2',
    img: imgSrc,
  }
])


const changeTab = (i) => {
  tabIndex.value = i
}

const changeListItem = (i) => {
  listItemIndex.value = i
}

</script>

<style lang="less" scoped>
.scenery-container {
  height: 100%;
  color: @color-white;

  .scenery-title {
    width: 100%;
    height: 35px;
    background-color: @bg-default;
    box-sizing: border-box;
    padding-left: 20px;
    margin-bottom: 20px;

    .tab {
      margin-right: 40px;
      color: @font-color-default;
      cursor: pointer;

      &.active {
        color: @color-white;
      }
    }
  }

  .scenery-content {
    .left {
      width: 300px;
      height: 100%;
      margin-right: 20px;
      padding: 10px;
      box-sizing: border-box;
      overflow-x: hidden;
      overflow-y: auto;
      background-color: @bg-default;

      .left-title {
        margin-bottom: 20px;
        color: @color-white;

        h3 {
          margin: 0;
          padding: 0;
        }

        .btn {
          font-size: 12px;
          color: @btn-color;
          cursor: pointer;
        }
      }

      .left-list {
        .list-item {
          width: 100%;
          margin-bottom: 10px;
          padding: 5px;
          box-sizing: border-box;
          overflow: hidden;
          border: 1px solid transparent;

          .item-img {
            margin-right: 10px;
          }

          .item-desc {
            width: 100%;
            padding-bottom: 10px;

            .name {
              white-space: wrap;
              word-break: break-all;
            }

            .btn {
              font-size: 12px;
              color: @color-white;
              cursor: pointer;
            }
          }

          &.active {
            border: 1px solid @color-white
          }
        }
      }
    }

    .right {
      color: @color-white;
      padding: 20px;
      background-color: @bg-default;

      .right-top {
        width: 100%;

        .top-item {
          width: 48%;

          .title {
            margin-bottom: 20px;

            .btn {
              font-size: 12px;
              color: @btn-color;
              cursor: pointer;
            }
          }

          .play-box {
            background-color: @color-white;
            width: 150px;
            height: 80px;
            border-radius: 12px;
            color: #000;
            margin-right: 20px;
          }

          .action-box {
            height: 80px;

            .cell {
              width: 200px;
              white-space: nowrap;
            }
          }
        }

      }

      .right-down {
        margin-top: 20px;

        h3 {
          margin-bottom: 20px;
        }

        .flex-col {
          display: flex;
          align-items: center;
          font-size: 12px;
          white-space: nowrap;

          .label {
            margin-right: 10px;
          }
        }

        .right-list {
          margin-top: 20px;

          .list-item {
            position: relative;
            background-color: #000;
            margin-right: 20px;
            width: 120px;
            height: 200px;

            img {
              width: 100%;
              height: 100%;
            }

            .action {
              position: absolute;
              background-color: rgba(0, 0, 0, 0.8);
              left: 0;
              bottom: 0;
              padding: 5px;
              width: 100%;
              box-sizing: border-box;
              font-size: 12px;
            }
          }
        }
      }
    }
  }
}
</style>